<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\lose\model;

use think\Model;

class WechatPublicNumberModel extends Model
{

    /**
     * 后台管理添加公众号
     * @param array $data 公众号数据
     * @return $this
     */
    public function adminAddPublicNumber($data)
    {

        $this->allowField(true)->data($data, true)->isUpdate(false)->save();

        return $this;
    }

    /**
     * 后台管理编辑公众号
     * @param array $data 公众号数据
     * @param array|string $categories 公众号分类 id
     * @return $this
     */
    public function adminEditPublicNumber($data)
    {
        $this->allowField(true)->isUpdate(true)->data($data, true)->save();

        return $this;
    }

}
